﻿using System.Web.Mvc;
using System.Configuration;
using System;
using IloveRSS.Models;

namespace IloveRSS.Core
{
    public class ILoveRssControllerFactory : DefaultControllerFactory
    {
        protected override IController GetControllerInstance(System.Web.Routing.RequestContext requestContext, System.Type controllerType)
        {
            String connectionString = ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString;
            return Activator.CreateInstance(controllerType, new DataManager(connectionString)) as IController;
        }
    }
}